package com.yongbao.model.util;

import com.yongbao.model.dtomapper.DishOrderDtoMapper;
import com.yongbao.model.domain.DishOrderDO;
import com.yongbao.model.vo.DishOrderVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class DishOrderConvert {

    public static List<DishOrderVO> buildDishOrderVoList(List<DishOrderDO> dishOrderDOList) {
        if (CollectionUtils.isEmpty(dishOrderDOList)) {
            return Lists.newArrayList();
        }
        List<DishOrderVO> dishOrderVOList = new ArrayList<>();
        for (DishOrderDO dishOrderDO : dishOrderDOList) {
            dishOrderVOList.add(DishOrderDtoMapper.INSTANCE.do2VO(dishOrderDO));
        }

        return dishOrderVOList;
    }
}
